{extend name="base"/}
{block name="css"}
<style>
    body{background: none !important;}
    .layui-body {
        position: absolute;
        left: 300px;
        right: 0;
        top: 20px;
        bottom: 0;
        z-index: 998;
        width: auto;
        overflow: hidden;
        overflow-y: auto;
        box-sizing: border-box;
    }
</style>
{/block}
{block name="content"}

<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-lg12">
            <fieldset class="layui-elem-field">
                <legend>海报设置</legend>
                <div class="layui-field-box">
                    <form class="layui-form" >
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 110px">默认海报</label>
                            <button type="button" class="layui-btn layui-btn-primary pull-left" style="text-align: center;line-height: 38px;border: none; background: #009688; color: #fff;" id="slide-pc">{:lang('选择图片')}</button>
                            <div class="pic-more">
                                <ul class="pic-more-upload-list" id="slide-pc-priview">
                                    <li class="item_img" style="position: relative;">
                                        <div class="operate" style="position: absolute; width: 20px; height: 20px; left: 178px;top: 5px;">
                                        </div>
                                        <img src="{$list[0]['condition']}" class="img" style="width: 200px; height: 200px;    margin-left: 100px;">
                                        <input type="hidden" class="shopimg" name="poster" value="{$list[0]['condition']}">
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 110px">默认链接</label>
                            <div class="layui-input-inline">
                                <input  name="default_link" required lay-verify="required" value="{$list[1]['condition']}" placeholder="默认链接" autocomplete="off"  class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="editConfig14">立即提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </fieldset>
        </div>
    </div>
</div>




{/block}
{block name="js"}
<script type="text/javascript" src="__ADMIN__/js/reward.js"></script>
<script>
    layui.use('upload', function () {
        var $ = layui.jquery;
        var upload = layui.upload;
        upload.render({
            elem: '#slide-pc',
            url: "/backend/goods/upload_img",
            size: 10000,
            type: "post",
            exts: 'jpg|png|jpeg',
            multiple: true,
            number: 9,
            before: function (obj) {
                layer.msg('图片上传中...', {
                    icon: 16,
                    shade: 0.01,
                    time: 0
                })
            },
            done: function (res) {

                console.log(res);
                layer.close(layer.msg()); //关闭上传提示窗口
                if (res.status == 0) {
                    return layer.msg(res.message);
                }
                $('#slide-pc-priview').html(
                        '<li class="item_img" style="position: relative;"><div class="operate"  style="position: absolute; width: 20px; height: 20px; left: 178px;top: 5px;"></div><img src="' +
                        res.filepath +
                        '" class="img" style="width: 200px; height: 200px;    margin-left: 100px;"><input type="hidden" class="shopimg" name="poster" value="' +
                        res.filepath + '" /></li>');
            }
        });
    });
</script>
{/block}
